package cate.game.role.res.call.msg;

import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBHeroCall;
import cate.game.res.MixRes;
import cate.game.role.bag.hero.Hero;
import cate.game.role.res.call.base.CallHeroResultItem;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteField;
import lombok.Setter;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;


@ClientMsg(title = "召唤执行 の 返回")
public class CallExeResp implements MsgOutput {

    public CallExeResp() {
    }

    @NoteField(value = "英雄召唤类型")
    public Byte type;

    @NoteField(value = "英雄召唤结果")
    public List<CallHeroResultItem> result = new ArrayList<>();

    @NoteField(value = "额外奖励")
    public MixRes reward = new MixRes();

    @NoteField(value = "碎片")
    public List<MixRes> fragments = new ArrayList<>();

    @NoteField(value = "碎片")
    @JsonIgnore
    public List<Integer> fragUidList = new ArrayList<>();

    @Setter
    @NoteField(value = "放逐英雄")
    public List<Hero> sacrifices = new LinkedList<>();

    @NoteField("活动额外奖励")
    public MixRes actExtraReward = new MixRes();

    public void add(int tid, boolean focus, boolean dup) {
        CallHeroResultItem item = new CallHeroResultItem();
        item.tid = tid;
        item.focus = focus;
        item.dup = dup;
        result.add(item);
    }

    public void setReward(MixRes res) {
        reward = res;
    }
    @Override
    public MsgConfig conf() {
        return MsgIdBHeroCall.CALL_EXE_RESP;
    }

}
